﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.UI.WebControls;
using Medianamik.UI.Web.Shop;
using Medianamik.UI.Web.MVP.View;
using Medianamik.UI.Web.Shop.Data;

namespace Medianamik.UI.Web.Shop
{
    public partial class ShopModelGroups : ModuleViewWithGrid<IModelGroups>, IModelGroups
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            FilterButton.Click += OnFilterButton;
        }

        public override Guid BaseTypeId
        {
            get
            {
                return ModelGroup.TYPE_ID;
            }
        }

        void OnFilterButton(object sender, EventArgs e)
        {
            OnFilter();
        }

        public override IMedianamikGrid Grid
        {
            get { return (IMedianamikGrid)ModelGroupsGrid; }
        }

        public override HyperLink AddButton
        {
            get { return AddArticleButton; }
        }

        public override IEnumerable<ListItem> Status
        {
            get { return ContentStatesList.Items.Cast<ListItem>(); }
            set
            {
                ContentStatesList.Items.AddRange(value.ToArray());
            }
        }

        public override DateTime? SelectedStartDateTime
        {
            get { return null; }
            set { }
        }

        public override DateTime? SelectedEndDateTime
        {
            get { return null; }
            set { }
        }

        public override string Keywords
        {
            get { return Name.Text; }
            set { Name.Text = value; }
        }

        public override Guid ModuleNodeId
        {
            get{ return Modules.Shop; }
        }

        public override string ListingPageUrl
        {
            get { return Pages.ModelGroupList; }
        }

        public override string EditPageUrl
        {
            get
            {
                return Pages.Edit;
            }
        }

        public override string BreadcrumbTrail
        {
            get { return Breadcrumbs.Text; }
            set { Breadcrumbs.Text = value; }
        }

        public override string ChildrenListingPageUrl
        {
            get
            {
                return Pages.ModelList;
            }
        }


        public override string TypeSelectorUrl
        {
            get
            {
                return EditPageUrl;
            }
        }


        public override string RootListingPageUrl
        {
            get { return Pages.ProductList; }
        }


        public override bool IsMultiLingual
        {
            get
            {
                return true;
            }
        }
    }

    public interface IModelGroups : IModuleViewWithGrid
    {
    }
}